﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;

namespace LAMSDK.Database.Infrastructure
{
    public class DatabaseFactory:Disposable,IDatabaseFactory
    {
        private DbContext Database;

        public DatabaseFactory(DbContext database)
        {
            this.Database = database;
        }

        public DbContext Get()
        {
            return Database;
        }

        protected override void DisposeCore()
        {
            if (Database != null)
                Database.Dispose();
        }
    }
}
